<?php
require_once dirname(__FILE__) . "/../PUB/class/tools/ServerFunction.class.php";
require_once dirname(__FILE__) . "/../PUB/class/db/DAB.class.php";
require_once "Constant.class.php";

$big_num=array(1=>"一","二","三","四","五","六","七","八","九","十","十一","十二","十三","十四","十五");

$dab=new DAB("");

$dab->connectDB($db_alias);

$sql="select stu_no,stu_id from cls_stu_data where cls_no='" . $_GET["class"] . "'";

$rs=$dab->query($sql);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>國立溪湖高中『高中電腦』的班級作業網站</title>
    </head>
    <body bgcolor='#99CCFF'>
        <P align="center">
            <font size="6" face="標楷體">國立溪湖高中『高中電腦』的班級作業網站</font>
        </P>

        <p align='center'>
            <b>
                <font size='5' color='#FF00FF'>
                    <?php echo $_GET["class"] . " &nbsp;" . $big_num[substr($_GET["class"], 0, 1)] . "年" . $big_num[substr($_GET["class"], 1, 2)] . "班  &nbsp;學生個人網站" ?>
                </font>
            </b>
        </p>
        <p align='center'>
            <table border='1' width='612'>
                <?php
                    $row_count=0;
                    foreach ($rs as $row){
                        if($row_count%6==0 && $row_count<>0){echo "<tr>";}

                        echo "<td style='background-color: #FF9933; border-style: solid; border-color: #FF00FF' width='101' align='center'>";
                        echo "<font size='5' color='#0000FF' face='標楷體'>";
                        echo "<a href='http://".$_SERVER['SERVER_NAME']."/".$row["stu_id"]."'>座號".$row["stu_no"]."</a>";

                        if($row_count%6==5 && $row_count<>0){echo "</tr>";}

                        $row_count++;
                    }
                ?>
            </table>
        </p>
        <p align='center'><a href='http://<?php echo $_SERVER['SERVER_NAME'] ?>/SHS/'>回網站首頁</a></p>
    </body>
</html>
